
const webpack = require("webpack");

/**
 * 端口号 通过配置文件来获取
 * 
 * 可在项目目录中的.env.xxx文件修改
 *  development 开发环境
 *  production  生产环境
 */
const SERVER_PORT = process.env.VUE_APP_SERVER_PORT

module.exports = {
  // 加速生产环境构建
  productionSourceMap: false,
  publicPath: "/",
  assetsDir: 'static',
  lintOnSave: false,
  devServer: {
    host: '0.0.0.0',
    port: SERVER_PORT,
    open: false,
    overlay: {
      warnings: false, errors: true
    },
    progress: false,
  },
  configureWebpack: config => {
    // 配置jquery
    config.plugins.push(
      new webpack.ProvidePlugin({
        $: "jquery",
        jQuery: "jquery",
        "windows.jQuery": "jquery"
      })
    )
  }
}

